package me.mcx.mcx.web.controller;

import me.mcx.common.core.controller.BaseController;
import me.mcx.common.core.domain.AjaxResult;
import me.mcx.mcx.domain.McxHonor;
import me.mcx.mcx.service.IMcxHonorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 荣誉墙Controller
 * 
 * @author mcx
 * @date 2024-09-21
 */
@RestController
@RequestMapping("/api/mcx/honor")
public class ApiMcxHonorController extends BaseController
{
    @Autowired
    private IMcxHonorService mcxHonorService;

    /**
     * 查询荣誉墙列表
     */
    @GetMapping("/list")
    public AjaxResult list(McxHonor mcxHonor)
    {
        List<McxHonor> list = mcxHonorService.selectMcxHonorList(mcxHonor);
        return success(list);
    }

    /**
     * 获取荣誉墙详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(mcxHonorService.selectMcxHonorById(id));
    }
}
